/**
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.gitee.huangjianbo.supos.openapi.httpclient5.request;

import io.gitee.huangjianbo.supos.openapi.core.errors.InvalidArgumentsException;
import io.gitee.huangjianbo.supos.openapi.core.http.request.RequestArguments;
import io.gitee.huangjianbo.supos.openapi.core.tools.StringUtils;

/**
 *
 * @author tomcat
 * @version 1.0
 */
public class BatchAddRoleArgs implements RequestArguments {
    private static final long serialVersionUID = -6848426549018930483L;

    private String code;

    private String name;

    private String description;

    public BatchAddRoleArgs() {

    }

    public BatchAddRoleArgs(String code, String name, String description) {
        this.code = code;
        this.name = name;
        this.description = description;
    }

    @Override
    public boolean validate() {
        if (StringUtils.isEmpty(code)) {
            throw new InvalidArgumentsException("The filed of code must not be empty");
        }
        if (StringUtils.isEmpty(name)) {
            throw new InvalidArgumentsException("The filed of name must not be empty");
        }
        return true;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
